﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SocketClient;

namespace TestSocketClient
{
    class Program
    {
        static void Main(string[] args)
        {
            SClient client = new SClient("127.0.0.1", 12012);
            client.UnkownCommandHandler += new CommandHandler(client_UnkownCommandHandler);
            client.AddCommand("PLAYER_LIST", PLAYER_LIST_Command);

            string text = null;
            do
            {
                if(text != null)
                    client.Command(text);
                text = Console.ReadLine();
            } while (text != "Quit");

            client.Close();
        }

        static void client_UnkownCommandHandler(string data)
        {
            Console.WriteLine(data);
        }

        static void PLAYER_LIST_Command(string data)
        {
            Console.WriteLine("PL:" + data);
        }
    }
}
